package foodserver;

import java.io.PrintWriter;

import javax.servlet.ServletException;

import javax.servlet.http.*;

import org.json.JSONException;
import org.json.JSONObject;

import com.subway.babynote.syncdata.*;

import querysrc.query_RegUser;
import querysrc.query_login;
import querysrc.sqlConnectionHandler;
import querysrc.sqlConnectionHandlerManager;




public class RegUser extends addbase {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	query_RegUser qa = null;	 
	 
	public RegUser() {
		// TODO Auto-generated constructor stub
	}
	protected void initialize_subquery()
	{
		qa = new query_RegUser(this.sqlconhandler);
	}
	protected void destory_subquery()
	{
		this.release_query(qa);
	}
	protected int add_data(JSONObject input_jsono)
	{
		try
		 {	
			 ClientDataRecord.usersRecord ur = new ClientDataRecord.usersRecord(input_jsono);
			 
			 int id = qa.Register(ur);
		     return id;			 
		     
		 }
		 
		 catch (Exception e) {
			 System.out.println("FeedSync doPost error:" + e.getMessage());
		      e.printStackTrace();
		      return -1;
		    }
	}		
	
	
}
